package com.forum.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.forum.bean.Articles;
import com.forum.dto.ArticleDetailDto;
import com.forum.dto.ArticleListDto;
import com.forum.dto.CommentDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticlesMapper extends BaseMapper<Articles> {
    IPage<ArticleListDto> selectArticleList(@Param("page") Page<ArticleListDto> page, @Param("title") String title,
                                            @Param("userId") Integer userId,@Param("status") Integer status,@Param("typeId") Integer typeId);


    ArticleDetailDto selectArticleDetail(@Param("articleId") Integer articleId, @Param("userId") Integer userId);

    List<CommentDto> selectComments(@Param("articleId") Integer articleId);
}

